Imports System 
Imports System.Text 
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.Common
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Configuration 
Imports System.Xml 
Imports System.Xml.Serialization
Imports SubSonic 
Imports SubSonic.Utilities
Namespace Data
	''' <summary>
	''' Strongly-typed collection for the AspnetMembership class.
	''' </summary>
	<Serializable> _
	Public Partial Class AspnetMembershipCollection 
	Inherits ActiveList(Of AspnetMembership, AspnetMembershipCollection)
	    Public Sub New()
		End Sub
	End Class
	''' <summary>
	''' This is an ActiveRecord class which wraps the aspnet_Membership table.
	''' </summary>
	<Serializable> _
	Public Partial Class AspnetMembership 
	Inherits ActiveRecord(Of AspnetMembership)
		#Region ".ctors and Default Settings"
		
		Public Sub New()
			SetSQLProps()
			InitSetDefaults()
			MarkNew()
		End Sub
		
		Public Sub New(ByVal useDatabaseDefaults As Boolean)
			SetSQLProps()
			If useDatabaseDefaults = True Then
				ForceDefaults()
			End If
			MarkNew()
		End Sub
		Public Sub New(ByVal keyID As Object)
			SetSQLProps()
			InitSetDefaults()
			LoadByKey(keyID)
		End Sub
		Public Sub New(ByVal columnName As String, ByVal columnValue As Object)
			SetSQLProps()
			InitSetDefaults()
			LoadByParam(columnName,columnValue)
		End Sub
		Private Sub InitSetDefaults()
			SetDefaults()
		End Sub
		
		Protected Shared Sub SetSQLProps()
			GetTableSchema()
		End Sub
		#End Region
		
		#Region "Schema and Query Accessor"
		
		Public Shared ReadOnly Property Schema() As TableSchema.Table
			Get
				If BaseSchema Is Nothing Then
					SetSQLProps()
				End If
				Return BaseSchema
			End Get
		End Property
		Private Shared Sub GetTableSchema()
			If (Not IsSchemaInitialized) Then
				'Schema declaration
				Dim schema As TableSchema.Table = New TableSchema.Table("aspnet_Membership", TableType.Table, DataService.GetInstance("ClubStarterKitData"))
				schema.Columns = New TableSchema.TableColumnCollection()
				schema.SchemaName = "dbo"
				'columns
				
                
                Dim colvarApplicationId As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarApplicationId.ColumnName = "ApplicationId"
                colvarApplicationId.DataType = DbType.Guid
                colvarApplicationId.MaxLength = 0
                colvarApplicationId.AutoIncrement = false
                colvarApplicationId.IsNullable = false
                colvarApplicationId.IsPrimaryKey = false
                colvarApplicationId.IsForeignKey = true
                colvarApplicationId.IsReadOnly = false
                
                
				colvarApplicationId.ForeignKeyTableName = "aspnet_Applications"
                
                schema.Columns.Add(colvarApplicationId)
                
                Dim colvarUserId As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarUserId.ColumnName = "UserId"
                colvarUserId.DataType = DbType.Guid
                colvarUserId.MaxLength = 0
                colvarUserId.AutoIncrement = false
                colvarUserId.IsNullable = false
                colvarUserId.IsPrimaryKey = true
                colvarUserId.IsForeignKey = true
                colvarUserId.IsReadOnly = false
                
                
				colvarUserId.ForeignKeyTableName = "aspnet_Users"
                
                schema.Columns.Add(colvarUserId)
                
                Dim colvarPassword As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarPassword.ColumnName = "Password"
                colvarPassword.DataType = DbType.String
                colvarPassword.MaxLength = 128
                colvarPassword.AutoIncrement = false
                colvarPassword.IsNullable = false
                colvarPassword.IsPrimaryKey = false
                colvarPassword.IsForeignKey = false
                colvarPassword.IsReadOnly = false
                
                
                schema.Columns.Add(colvarPassword)
                
                Dim colvarPasswordFormat As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarPasswordFormat.ColumnName = "PasswordFormat"
                colvarPasswordFormat.DataType = DbType.Int32
                colvarPasswordFormat.MaxLength = 0
                colvarPasswordFormat.AutoIncrement = false
                colvarPasswordFormat.IsNullable = false
                colvarPasswordFormat.IsPrimaryKey = false
                colvarPasswordFormat.IsForeignKey = false
                colvarPasswordFormat.IsReadOnly = false
                
						colvarPasswordFormat.DefaultSetting = "((0))"
				
                
                schema.Columns.Add(colvarPasswordFormat)
                
                Dim colvarPasswordSalt As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarPasswordSalt.ColumnName = "PasswordSalt"
                colvarPasswordSalt.DataType = DbType.String
                colvarPasswordSalt.MaxLength = 128
                colvarPasswordSalt.AutoIncrement = false
                colvarPasswordSalt.IsNullable = false
                colvarPasswordSalt.IsPrimaryKey = false
                colvarPasswordSalt.IsForeignKey = false
                colvarPasswordSalt.IsReadOnly = false
                
                
                schema.Columns.Add(colvarPasswordSalt)
                
                Dim colvarMobilePIN As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarMobilePIN.ColumnName = "MobilePIN"
                colvarMobilePIN.DataType = DbType.String
                colvarMobilePIN.MaxLength = 16
                colvarMobilePIN.AutoIncrement = false
                colvarMobilePIN.IsNullable = true
                colvarMobilePIN.IsPrimaryKey = false
                colvarMobilePIN.IsForeignKey = false
                colvarMobilePIN.IsReadOnly = false
                
                
                schema.Columns.Add(colvarMobilePIN)
                
                Dim colvarEmail As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarEmail.ColumnName = "Email"
                colvarEmail.DataType = DbType.String
                colvarEmail.MaxLength = 256
                colvarEmail.AutoIncrement = false
                colvarEmail.IsNullable = true
                colvarEmail.IsPrimaryKey = false
                colvarEmail.IsForeignKey = false
                colvarEmail.IsReadOnly = false
                
                
                schema.Columns.Add(colvarEmail)
                
                Dim colvarLoweredEmail As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarLoweredEmail.ColumnName = "LoweredEmail"
                colvarLoweredEmail.DataType = DbType.String
                colvarLoweredEmail.MaxLength = 256
                colvarLoweredEmail.AutoIncrement = false
                colvarLoweredEmail.IsNullable = true
                colvarLoweredEmail.IsPrimaryKey = false
                colvarLoweredEmail.IsForeignKey = false
                colvarLoweredEmail.IsReadOnly = false
                
                
                schema.Columns.Add(colvarLoweredEmail)
                
                Dim colvarPasswordQuestion As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarPasswordQuestion.ColumnName = "PasswordQuestion"
                colvarPasswordQuestion.DataType = DbType.String
                colvarPasswordQuestion.MaxLength = 256
                colvarPasswordQuestion.AutoIncrement = false
                colvarPasswordQuestion.IsNullable = true
                colvarPasswordQuestion.IsPrimaryKey = false
                colvarPasswordQuestion.IsForeignKey = false
                colvarPasswordQuestion.IsReadOnly = false
                
                
                schema.Columns.Add(colvarPasswordQuestion)
                
                Dim colvarPasswordAnswer As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarPasswordAnswer.ColumnName = "PasswordAnswer"
                colvarPasswordAnswer.DataType = DbType.String
                colvarPasswordAnswer.MaxLength = 128
                colvarPasswordAnswer.AutoIncrement = false
                colvarPasswordAnswer.IsNullable = true
                colvarPasswordAnswer.IsPrimaryKey = false
                colvarPasswordAnswer.IsForeignKey = false
                colvarPasswordAnswer.IsReadOnly = false
                
                
                schema.Columns.Add(colvarPasswordAnswer)
                
                Dim colvarIsApproved As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarIsApproved.ColumnName = "IsApproved"
                colvarIsApproved.DataType = DbType.Boolean
                colvarIsApproved.MaxLength = 0
                colvarIsApproved.AutoIncrement = false
                colvarIsApproved.IsNullable = false
                colvarIsApproved.IsPrimaryKey = false
                colvarIsApproved.IsForeignKey = false
                colvarIsApproved.IsReadOnly = false
                
                
                schema.Columns.Add(colvarIsApproved)
                
                Dim colvarIsLockedOut As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarIsLockedOut.ColumnName = "IsLockedOut"
                colvarIsLockedOut.DataType = DbType.Boolean
                colvarIsLockedOut.MaxLength = 0
                colvarIsLockedOut.AutoIncrement = false
                colvarIsLockedOut.IsNullable = false
                colvarIsLockedOut.IsPrimaryKey = false
                colvarIsLockedOut.IsForeignKey = false
                colvarIsLockedOut.IsReadOnly = false
                
                
                schema.Columns.Add(colvarIsLockedOut)
                
                Dim colvarCreateDate As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarCreateDate.ColumnName = "CreateDate"
                colvarCreateDate.DataType = DbType.DateTime
                colvarCreateDate.MaxLength = 0
                colvarCreateDate.AutoIncrement = false
                colvarCreateDate.IsNullable = false
                colvarCreateDate.IsPrimaryKey = false
                colvarCreateDate.IsForeignKey = false
                colvarCreateDate.IsReadOnly = false
                
                
                schema.Columns.Add(colvarCreateDate)
                
                Dim colvarLastLoginDate As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarLastLoginDate.ColumnName = "LastLoginDate"
                colvarLastLoginDate.DataType = DbType.DateTime
                colvarLastLoginDate.MaxLength = 0
                colvarLastLoginDate.AutoIncrement = false
                colvarLastLoginDate.IsNullable = false
                colvarLastLoginDate.IsPrimaryKey = false
                colvarLastLoginDate.IsForeignKey = false
                colvarLastLoginDate.IsReadOnly = false
                
                
                schema.Columns.Add(colvarLastLoginDate)
                
                Dim colvarLastPasswordChangedDate As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarLastPasswordChangedDate.ColumnName = "LastPasswordChangedDate"
                colvarLastPasswordChangedDate.DataType = DbType.DateTime
                colvarLastPasswordChangedDate.MaxLength = 0
                colvarLastPasswordChangedDate.AutoIncrement = false
                colvarLastPasswordChangedDate.IsNullable = false
                colvarLastPasswordChangedDate.IsPrimaryKey = false
                colvarLastPasswordChangedDate.IsForeignKey = false
                colvarLastPasswordChangedDate.IsReadOnly = false
                
                
                schema.Columns.Add(colvarLastPasswordChangedDate)
                
                Dim colvarLastLockoutDate As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarLastLockoutDate.ColumnName = "LastLockoutDate"
                colvarLastLockoutDate.DataType = DbType.DateTime
                colvarLastLockoutDate.MaxLength = 0
                colvarLastLockoutDate.AutoIncrement = false
                colvarLastLockoutDate.IsNullable = false
                colvarLastLockoutDate.IsPrimaryKey = false
                colvarLastLockoutDate.IsForeignKey = false
                colvarLastLockoutDate.IsReadOnly = false
                
                
                schema.Columns.Add(colvarLastLockoutDate)
                
                Dim colvarFailedPasswordAttemptCount As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarFailedPasswordAttemptCount.ColumnName = "FailedPasswordAttemptCount"
                colvarFailedPasswordAttemptCount.DataType = DbType.Int32
                colvarFailedPasswordAttemptCount.MaxLength = 0
                colvarFailedPasswordAttemptCount.AutoIncrement = false
                colvarFailedPasswordAttemptCount.IsNullable = false
                colvarFailedPasswordAttemptCount.IsPrimaryKey = false
                colvarFailedPasswordAttemptCount.IsForeignKey = false
                colvarFailedPasswordAttemptCount.IsReadOnly = false
                
                
                schema.Columns.Add(colvarFailedPasswordAttemptCount)
                
                Dim colvarFailedPasswordAttemptWindowStart As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarFailedPasswordAttemptWindowStart.ColumnName = "FailedPasswordAttemptWindowStart"
                colvarFailedPasswordAttemptWindowStart.DataType = DbType.DateTime
                colvarFailedPasswordAttemptWindowStart.MaxLength = 0
                colvarFailedPasswordAttemptWindowStart.AutoIncrement = false
                colvarFailedPasswordAttemptWindowStart.IsNullable = false
                colvarFailedPasswordAttemptWindowStart.IsPrimaryKey = false
                colvarFailedPasswordAttemptWindowStart.IsForeignKey = false
                colvarFailedPasswordAttemptWindowStart.IsReadOnly = false
                
                
                schema.Columns.Add(colvarFailedPasswordAttemptWindowStart)
                
                Dim colvarFailedPasswordAnswerAttemptCount As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarFailedPasswordAnswerAttemptCount.ColumnName = "FailedPasswordAnswerAttemptCount"
                colvarFailedPasswordAnswerAttemptCount.DataType = DbType.Int32
                colvarFailedPasswordAnswerAttemptCount.MaxLength = 0
                colvarFailedPasswordAnswerAttemptCount.AutoIncrement = false
                colvarFailedPasswordAnswerAttemptCount.IsNullable = false
                colvarFailedPasswordAnswerAttemptCount.IsPrimaryKey = false
                colvarFailedPasswordAnswerAttemptCount.IsForeignKey = false
                colvarFailedPasswordAnswerAttemptCount.IsReadOnly = false
                
                
                schema.Columns.Add(colvarFailedPasswordAnswerAttemptCount)
                
                Dim colvarFailedPasswordAnswerAttemptWindowStart As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarFailedPasswordAnswerAttemptWindowStart.ColumnName = "FailedPasswordAnswerAttemptWindowStart"
                colvarFailedPasswordAnswerAttemptWindowStart.DataType = DbType.DateTime
                colvarFailedPasswordAnswerAttemptWindowStart.MaxLength = 0
                colvarFailedPasswordAnswerAttemptWindowStart.AutoIncrement = false
                colvarFailedPasswordAnswerAttemptWindowStart.IsNullable = false
                colvarFailedPasswordAnswerAttemptWindowStart.IsPrimaryKey = false
                colvarFailedPasswordAnswerAttemptWindowStart.IsForeignKey = false
                colvarFailedPasswordAnswerAttemptWindowStart.IsReadOnly = false
                
                
                schema.Columns.Add(colvarFailedPasswordAnswerAttemptWindowStart)
                
                Dim colvarComment As TableSchema.TableColumn = New TableSchema.TableColumn(schema)
                colvarComment.ColumnName = "Comment"
                colvarComment.DataType = DbType.String
                colvarComment.MaxLength = 1073741823
                colvarComment.AutoIncrement = false
                colvarComment.IsNullable = true
                colvarComment.IsPrimaryKey = false
                colvarComment.IsForeignKey = false
                colvarComment.IsReadOnly = false
                
                
                schema.Columns.Add(colvarComment)
                
				BaseSchema = schema
				
				'add this schema to the provider
                'so we can query it later
                DataService.Providers("ClubStarterKitData").AddSchema("aspnet_Membership",schema)
			End If
		End Sub
		Public Shared Function CreateQuery() As Query
			Return New Query(Schema)
		End Function
		
		#End Region
		
		#Region "Props"
	
          
        <XmlAttribute("ApplicationId")> _
        Public Property ApplicationId As Guid 
			Get
				Return GetColumnValue(Of Guid)("ApplicationId")
			End Get
		    
			Set
				SetColumnValue("ApplicationId", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("UserId")> _
        Public Property UserId As Guid 
			Get
				Return GetColumnValue(Of Guid)("UserId")
			End Get
		    
			Set
				SetColumnValue("UserId", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("Password")> _
        Public Property Password As String 
			Get
				Return GetColumnValue(Of String)("Password")
			End Get
		    
			Set
				SetColumnValue("Password", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("PasswordFormat")> _
        Public Property PasswordFormat As Integer 
			Get
				Return GetColumnValue(Of Integer)("PasswordFormat")
			End Get
		    
			Set
				SetColumnValue("PasswordFormat", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("PasswordSalt")> _
        Public Property PasswordSalt As String 
			Get
				Return GetColumnValue(Of String)("PasswordSalt")
			End Get
		    
			Set
				SetColumnValue("PasswordSalt", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("MobilePIN")> _
        Public Property MobilePIN As String 
			Get
				Return GetColumnValue(Of String)("MobilePIN")
			End Get
		    
			Set
				SetColumnValue("MobilePIN", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("Email")> _
        Public Property Email As String 
			Get
				Return GetColumnValue(Of String)("Email")
			End Get
		    
			Set
				SetColumnValue("Email", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("LoweredEmail")> _
        Public Property LoweredEmail As String 
			Get
				Return GetColumnValue(Of String)("LoweredEmail")
			End Get
		    
			Set
				SetColumnValue("LoweredEmail", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("PasswordQuestion")> _
        Public Property PasswordQuestion As String 
			Get
				Return GetColumnValue(Of String)("PasswordQuestion")
			End Get
		    
			Set
				SetColumnValue("PasswordQuestion", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("PasswordAnswer")> _
        Public Property PasswordAnswer As String 
			Get
				Return GetColumnValue(Of String)("PasswordAnswer")
			End Get
		    
			Set
				SetColumnValue("PasswordAnswer", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("IsApproved")> _
        Public Property IsApproved As Boolean 
			Get
				Return GetColumnValue(Of Boolean)("IsApproved")
			End Get
		    
			Set
				SetColumnValue("IsApproved", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("IsLockedOut")> _
        Public Property IsLockedOut As Boolean 
			Get
				Return GetColumnValue(Of Boolean)("IsLockedOut")
			End Get
		    
			Set
				SetColumnValue("IsLockedOut", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("CreateDate")> _
        Public Property CreateDate As DateTime 
			Get
				Return GetColumnValue(Of DateTime)("CreateDate")
			End Get
		    
			Set
				SetColumnValue("CreateDate", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("LastLoginDate")> _
        Public Property LastLoginDate As DateTime 
			Get
				Return GetColumnValue(Of DateTime)("LastLoginDate")
			End Get
		    
			Set
				SetColumnValue("LastLoginDate", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("LastPasswordChangedDate")> _
        Public Property LastPasswordChangedDate As DateTime 
			Get
				Return GetColumnValue(Of DateTime)("LastPasswordChangedDate")
			End Get
		    
			Set
				SetColumnValue("LastPasswordChangedDate", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("LastLockoutDate")> _
        Public Property LastLockoutDate As DateTime 
			Get
				Return GetColumnValue(Of DateTime)("LastLockoutDate")
			End Get
		    
			Set
				SetColumnValue("LastLockoutDate", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("FailedPasswordAttemptCount")> _
        Public Property FailedPasswordAttemptCount As Integer 
			Get
				Return GetColumnValue(Of Integer)("FailedPasswordAttemptCount")
			End Get
		    
			Set
				SetColumnValue("FailedPasswordAttemptCount", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("FailedPasswordAttemptWindowStart")> _
        Public Property FailedPasswordAttemptWindowStart As DateTime 
			Get
				Return GetColumnValue(Of DateTime)("FailedPasswordAttemptWindowStart")
			End Get
		    
			Set
				SetColumnValue("FailedPasswordAttemptWindowStart", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("FailedPasswordAnswerAttemptCount")> _
        Public Property FailedPasswordAnswerAttemptCount As Integer 
			Get
				Return GetColumnValue(Of Integer)("FailedPasswordAnswerAttemptCount")
			End Get
		    
			Set
				SetColumnValue("FailedPasswordAnswerAttemptCount", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("FailedPasswordAnswerAttemptWindowStart")> _
        Public Property FailedPasswordAnswerAttemptWindowStart As DateTime 
			Get
				Return GetColumnValue(Of DateTime)("FailedPasswordAnswerAttemptWindowStart")
			End Get
		    
			Set
				SetColumnValue("FailedPasswordAnswerAttemptWindowStart", Value)
			End Set
		End Property
		
		
		  
        <XmlAttribute("Comment")> _
        Public Property Comment As String 
			Get
				Return GetColumnValue(Of String)("Comment")
			End Get
		    
			Set
				SetColumnValue("Comment", Value)
			End Set
		End Property
		
		
		
		
		#End Region
		
		
			    
	    
		
		
		
		
		
	    
	    #Region "ForeignKey Methods"
	    
		''' <summary>
		''' Returns a AspnetApplications ActiveRecord object related to this AspnetMembership
		''' </summary>
		Public Property AspnetApplications() As Data.AspnetApplications
			Get
				Return Data.AspnetApplications.FetchByID(Me.ApplicationId)
			End Get
			Set
				SetColumnValue("ApplicationId", Value.ApplicationId)
			End Set
		End Property
	    
		''' <summary>
		''' Returns a AspnetUsers ActiveRecord object related to this AspnetMembership
		''' </summary>
		Public Property AspnetUsers() As Data.AspnetUsers
			Get
				Return Data.AspnetUsers.FetchByID(Me.UserId)
			End Get
			Set
				SetColumnValue("UserId", Value.UserId)
			End Set
		End Property
	    
	    #End Region
	    
		
	    
	    'no ManyToMany tables defined (0)
	    
		
		#Region "ObjectDataSource support"
		
		''' <summary>
		''' Inserts a record, can be used with the Object Data Source
		''' </summary>
		Public Shared Sub Insert(ByVal varApplicationId As Guid,ByVal varUserId As Guid,ByVal varPassword As String,ByVal varPasswordFormat As Integer,ByVal varPasswordSalt As String,ByVal varMobilePIN As String,ByVal varEmail As String,ByVal varLoweredEmail As String,ByVal varPasswordQuestion As String,ByVal varPasswordAnswer As String,ByVal varIsApproved As Boolean,ByVal varIsLockedOut As Boolean,ByVal varCreateDate As DateTime,ByVal varLastLoginDate As DateTime,ByVal varLastPasswordChangedDate As DateTime,ByVal varLastLockoutDate As DateTime,ByVal varFailedPasswordAttemptCount As Integer,ByVal varFailedPasswordAttemptWindowStart As DateTime,ByVal varFailedPasswordAnswerAttemptCount As Integer,ByVal varFailedPasswordAnswerAttemptWindowStart As DateTime,ByVal varComment As String)
			Dim item As AspnetMembership = New AspnetMembership()
			
            item.ApplicationId = varApplicationId
            
            item.UserId = varUserId
            
            item.Password = varPassword
            
            item.PasswordFormat = varPasswordFormat
            
            item.PasswordSalt = varPasswordSalt
            
            item.MobilePIN = varMobilePIN
            
            item.Email = varEmail
            
            item.LoweredEmail = varLoweredEmail
            
            item.PasswordQuestion = varPasswordQuestion
            
            item.PasswordAnswer = varPasswordAnswer
            
            item.IsApproved = varIsApproved
            
            item.IsLockedOut = varIsLockedOut
            
            item.CreateDate = varCreateDate
            
            item.LastLoginDate = varLastLoginDate
            
            item.LastPasswordChangedDate = varLastPasswordChangedDate
            
            item.LastLockoutDate = varLastLockoutDate
            
            item.FailedPasswordAttemptCount = varFailedPasswordAttemptCount
            
            item.FailedPasswordAttemptWindowStart = varFailedPasswordAttemptWindowStart
            
            item.FailedPasswordAnswerAttemptCount = varFailedPasswordAnswerAttemptCount
            
            item.FailedPasswordAnswerAttemptWindowStart = varFailedPasswordAnswerAttemptWindowStart
            
            item.Comment = varComment
            
			If Not System.Web.HttpContext.Current Is Nothing Then
				item.Save(System.Web.HttpContext.Current.User.Identity.Name)
			Else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name)
			End If
		End Sub
		''' <summary>
		''' Updates a record, can be used with the Object Data Source
		''' </summary>
		Public Shared Sub Update(ByVal varApplicationId As Guid,ByVal varUserId As Guid,ByVal varPassword As String,ByVal varPasswordFormat As Integer,ByVal varPasswordSalt As String,ByVal varMobilePIN As String,ByVal varEmail As String,ByVal varLoweredEmail As String,ByVal varPasswordQuestion As String,ByVal varPasswordAnswer As String,ByVal varIsApproved As Boolean,ByVal varIsLockedOut As Boolean,ByVal varCreateDate As DateTime,ByVal varLastLoginDate As DateTime,ByVal varLastPasswordChangedDate As DateTime,ByVal varLastLockoutDate As DateTime,ByVal varFailedPasswordAttemptCount As Integer,ByVal varFailedPasswordAttemptWindowStart As DateTime,ByVal varFailedPasswordAnswerAttemptCount As Integer,ByVal varFailedPasswordAnswerAttemptWindowStart As DateTime,ByVal varComment As String)
			Dim item As AspnetMembership = New AspnetMembership()
		    
                item.ApplicationId = varApplicationId
				
                item.UserId = varUserId
				
                item.Password = varPassword
				
                item.PasswordFormat = varPasswordFormat
				
                item.PasswordSalt = varPasswordSalt
				
                item.MobilePIN = varMobilePIN
				
                item.Email = varEmail
				
                item.LoweredEmail = varLoweredEmail
				
                item.PasswordQuestion = varPasswordQuestion
				
                item.PasswordAnswer = varPasswordAnswer
				
                item.IsApproved = varIsApproved
				
                item.IsLockedOut = varIsLockedOut
				
                item.CreateDate = varCreateDate
				
                item.LastLoginDate = varLastLoginDate
				
                item.LastPasswordChangedDate = varLastPasswordChangedDate
				
                item.LastLockoutDate = varLastLockoutDate
				
                item.FailedPasswordAttemptCount = varFailedPasswordAttemptCount
				
                item.FailedPasswordAttemptWindowStart = varFailedPasswordAttemptWindowStart
				
                item.FailedPasswordAnswerAttemptCount = varFailedPasswordAnswerAttemptCount
				
                item.FailedPasswordAnswerAttemptWindowStart = varFailedPasswordAnswerAttemptWindowStart
				
                item.Comment = varComment
				
			item.IsNew = False
			If Not System.Web.HttpContext.Current Is Nothing Then
				item.Save(System.Web.HttpContext.Current.User.Identity.Name)
			Else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name)
			End If
		End Sub
		#End Region
		#Region "Columns Struct"
		Public Structure Columns
			Dim x as Integer
			
            Public Shared ApplicationId As String = "ApplicationId"
            
            Public Shared UserId As String = "UserId"
            
            Public Shared Password As String = "Password"
            
            Public Shared PasswordFormat As String = "PasswordFormat"
            
            Public Shared PasswordSalt As String = "PasswordSalt"
            
            Public Shared MobilePIN As String = "MobilePIN"
            
            Public Shared Email As String = "Email"
            
            Public Shared LoweredEmail As String = "LoweredEmail"
            
            Public Shared PasswordQuestion As String = "PasswordQuestion"
            
            Public Shared PasswordAnswer As String = "PasswordAnswer"
            
            Public Shared IsApproved As String = "IsApproved"
            
            Public Shared IsLockedOut As String = "IsLockedOut"
            
            Public Shared CreateDate As String = "CreateDate"
            
            Public Shared LastLoginDate As String = "LastLoginDate"
            
            Public Shared LastPasswordChangedDate As String = "LastPasswordChangedDate"
            
            Public Shared LastLockoutDate As String = "LastLockoutDate"
            
            Public Shared FailedPasswordAttemptCount As String = "FailedPasswordAttemptCount"
            
            Public Shared FailedPasswordAttemptWindowStart As String = "FailedPasswordAttemptWindowStart"
            
            Public Shared FailedPasswordAnswerAttemptCount As String = "FailedPasswordAnswerAttemptCount"
            
            Public Shared FailedPasswordAnswerAttemptWindowStart As String = "FailedPasswordAnswerAttemptWindowStart"
            
            Public Shared Comment As String = "Comment"
            
		End Structure
		#End Region
	End Class
End Namespace
